//
//  NSArray+CZSafeAccess.h
//  OrangeCategory
//
//  Created by 橙子 on 2017/7/18.
//  Copyright © 2017年 Orange. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface NSArray (CZSafeAccess)

- (id)cz_objectWithIndex:(NSUInteger)index;

- (NSString*)cz_stringWithIndex:(NSUInteger)index;

- (NSNumber*)cz_numberWithIndex:(NSUInteger)index;

- (NSDecimalNumber *)cz_decimalNumberWithIndex:(NSUInteger)index;

- (NSArray*)cz_arrayWithIndex:(NSUInteger)index;

- (NSDictionary*)cz_dictionaryWithIndex:(NSUInteger)index;

- (NSInteger)cz_integerWithIndex:(NSUInteger)index;

- (NSUInteger)cz_unsignedIntegerWithIndex:(NSUInteger)index;

- (BOOL)cz_boolWithIndex:(NSUInteger)index;

- (int16_t)cz_int16WithIndex:(NSUInteger)index;

- (int32_t)cz_int32WithIndex:(NSUInteger)index;

- (int64_t)cz_int64WithIndex:(NSUInteger)index;

- (char)cz_charWithIndex:(NSUInteger)index;

- (short)cz_shortWithIndex:(NSUInteger)index;

- (float)cz_floatWithIndex:(NSUInteger)index;

- (double)cz_doubleWithIndex:(NSUInteger)index;

- (NSDate *)cz_dateWithIndex:(NSUInteger)index dateFormat:(NSString *)dateFormat;
//CG
- (CGFloat)cz_CGFloatWithIndex:(NSUInteger)index;

- (CGPoint)cz_pointWithIndex:(NSUInteger)index;

- (CGSize)cz_sizeWithIndex:(NSUInteger)index;

- (CGRect)cz_rectWithIndex:(NSUInteger)index;
@end


#pragma --mark NSMutableArray setter

@interface NSMutableArray(SafeAccess)

- (void)cz_addObj:(id)i;

- (void)cz_addString:(NSString*)i;

- (void)cz_addBool:(BOOL)i;

- (void)cz_addInt:(int)i;

- (void)cz_addInteger:(NSInteger)i;

- (void)cz_addUnsignedInteger:(NSUInteger)i;

- (void)cz_addCGFloat:(CGFloat)f;

- (void)cz_addChar:(char)c;

- (void)cz_addFloat:(float)i;

- (void)cz_addPoint:(CGPoint)o;

- (void)cz_addSize:(CGSize)o;

- (void)cz_addRect:(CGRect)o;

@end
